package com.rpoonolly.simplegame.core;

import java.io.Serializable;
import java.util.concurrent.atomic.AtomicLong;

public abstract class Entity implements Serializable {
	private static final long serialVersionUID = 3589530683407468268L;

	private static AtomicLong REF_COUNT = new AtomicLong(0);
	
	private final long id;
	protected int x, y;
	
	public Entity() {
		this( 0, 0 );
	}
	
	public Entity(int x, int y) {
		id = REF_COUNT.getAndIncrement();
		
		this.x = x;
		this.y = y;
	}
	
	public int getX() { return x; }
	public int getY() { return y; }
	public long getId() { return id; }
	
	public void setX(int x) { this.x = x; }
	public void setY(int y) { this.y = y; }
}
